/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package visualcbir.board;

//import Grid.AbstractBoard;
//import Grid.SubSet.Label;
import Grid.itemDistanceRn;
import java.awt.Point;
import java.util.Date;
import java.util.LinkedList;

/**
 *
 * @author robertopinho
 */
public abstract class AbstractCell implements CellItemInterface {
    private Integer col = 0;
    private Integer row = 0;
    //private Integer zed = 0;  //HEX Board third axis
    private LinkedList<itemDistanceRn> closeNeighbors = new LinkedList<itemDistanceRn>();
    private LinkedList<itemDistanceRn> randomNeighbors = new LinkedList<itemDistanceRn>();
    private boolean onBoard;
    private Double tempValue= new Double(0);
    private long spawnTime = new Date().getTime();
    
    private Label assignedLabel = null;
    
    //Real Position data
    private double realRow =0.0;
    private double realCol =0.0;
    
    public long getTime(){
        return spawnTime;
    }
    
    public String getURL(){
        return getLabel();
    }
    
    public LinkedList<itemDistanceRn> getCloseNeighbors() {
        return closeNeighbors;
    }

    public LinkedList<itemDistanceRn> getRandomNeighbors() {
        return randomNeighbors;
    }

    public boolean isOnBoard(){
        return this.onBoard;
    }
    
    public void setOnBoard(boolean b) {
        this.onBoard = b;
    }

    public void setRow(Integer i) {
        this.row=i;
    }

    public void setCol(Integer j) {
        this.col=j;
    }

    public Integer getRow() {
        return this.row;
    }

    public Integer getCol() {
        return this.col;
    }

    public Double getTempValue() {
        return tempValue;
    }

    public void setTempValue(Double tempValue) {
        this.tempValue = tempValue;
    }
    
    
    public Label getAssignedLabel() {
        return this.assignedLabel;
    }

    public void setAssignedLabel(Label assignedLabel) {
        if(this.assignedLabel==assignedLabel){
            return;
        }
        if(this.assignedLabel!=null){
            this.assignedLabel.removeItem(this);
        }
        this.assignedLabel = assignedLabel;
        this.assignedLabel.addItem(this);
    }


    
    
    public double getRealRow(){
        return realRow;
    }
    public double getRealCol(){
        return realCol;
    }
    
    
    //public Integer getZed() {
    //    return zed;
    //}

    //public void setZed(Integer zed) {
    //    this.zed = zed;
    //}

    

}
